package com.yc.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.entity.OrderInfo;
import com.yc.vo.OrderVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderVODao extends BaseMapper<OrderVO> {

    @Select("SELECT o.ono, m.nickName, a.name, a.addr, o.status, o.invoice, o.odate " +
            "FROM memberinfo m " +
            "JOIN addrinfo a ON m.mno = a.mno " +
            "JOIN orderinfo o ON a.ano = o.ano " +
            " order by date(o.odate) desc"+
            "   LIMIT #{pageNum}, #{pageSize} "
            )
    List<OrderVO> searchOrderInfos(@Param("orderVO") OrderVO orderVO, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

}
